/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Presentacion;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JOptionPane;
import javax.swing.WindowConstants;

/**
 *
 * @author Usuario
 */
public class JFrameMenuProgramadores extends javax.swing.JFrame {

    /**
     * Creates new form JFrameMenuAdministradores
     */
    public JFrameMenuProgramadores() {
        initComponents();
        setSize(1224, 650); 
        setResizable(false); 
        setVisible(true);
        setTitle("Bienvenidos Programadores de Vuelo");
        
        //Funcion para cerrar la 
        setDefaultCloseOperation (WindowConstants.DO_NOTHING_ON_CLOSE);
 
addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent we){
        int eleccion = JOptionPane.showConfirmDialog(null, "¿Desea salir?");
        if ( eleccion == 0) {
            JOptionPane.showMessageDialog(null, "Saliendo del Menu Programadores de Vuelo");
            dispose();//Cierra solo el frame selecionado!! ;) 
        }   
    }
});
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 50)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(153, 0, 0));
        jLabel1.setText("Bienvenidos");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(480, 20, 290, 61);

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
        jButton1.setText("Listar Vuelos");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(530, 520, 200, 50);

        jButton2.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
        jButton2.setText("Programar Vuelo");
        jButton2.setToolTipText("");
        jButton2.setPreferredSize(new java.awt.Dimension(153, 33));
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton2);
        jButton2.setBounds(530, 310, 200, 50);

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 50)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(153, 0, 0));
        jLabel2.setText("Programadores de Vuelo");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(350, 100, 550, 121);

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
        jButton3.setText("Programar Ciudad");
        getContentPane().add(jButton3);
        jButton3.setBounds(530, 420, 200, 50);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        JInternalFramePorgVueloCiudades frameVuelosCiudades = new JInternalFramePorgVueloCiudades();
        this.add(frameVuelosCiudades);
        setVisible(true);
        frameVuelosCiudades.setClosable(true);
        frameVuelosCiudades.setResizable(false);
        
        jLabel1.setLocation(10,10);
        jLabel2.setLocation(10,100);
        
        jButton3.setLocation(10, 250);
        jButton1.setLocation(10,350);
        jButton2.setLocation(10,450);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        JInternalFrameProgVuelos frameVuelos = new JInternalFrameProgVuelos();
        this.add(frameVuelos);
        setVisible(true);
        frameVuelos.setClosable(true);
        frameVuelos.setResizable(false);
        
        jLabel1.setLocation(10,10);
        jLabel2.setLocation(10,100);
        
        jButton3.setLocation(10, 250);
        jButton1.setLocation(10,350);
        jButton2.setLocation(10,450);
    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JFrameMenuProgramadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JFrameMenuProgramadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JFrameMenuProgramadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JFrameMenuProgramadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrameMenuProgramadores().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration//GEN-END:variables
}
